package com.always.electrical.energy.mqtt;

import com.always.electrical.energy.mqtt.res.MqttResponse;
import lombok.Data;
import lombok.experimental.Accessors;

import java.time.OffsetDateTime;

@Data
@Accessors(chain = true)
public class MqttTaskWrapper<RES extends MqttResponse> {

    private String token;

    private OffsetDateTime timestamp;

    private MqttTask<RES> body;

    public MqttTaskWrapper(String token, MqttTask<RES> body) {
        this.token = token;
        this.body = body;
        this.timestamp = OffsetDateTime.now();
    }

}
